import request from '@/utils/request'

//查询商家下拉框
export function shopSelectDown() {
    return request({
        url: `common/v1/shopSelectDown`,
        method: 'get',
    })
}

//统一字典下拉框查询
export function adminDict(params) {
    return request({
        url: `common/v1/adminDict`,
        params
    })
}

//新增福利卡
export function addBridgeCard(data) {
    return request({
      url: '/merchant/card/v1',
      method: 'post',
      data
    })
}

//福利卡列表
export function bridgeCardList(params) {
    return request({
        url: `/merchant/card/v1/list`,
        method: 'get',
        params
    })
}


//福利卡详情
export function bridgeCardDetail(params) {
    return request({
        url: `/merchant/card/v1/detail`,
        method: 'get',
        params
    })
}

// 恢复流通卡
export function resetCard(params) {
    return request({
        url: `/merchant/card/v1/reset`,
        method: 'put',
        params
    })
}

// 暂停流通卡
export function stopCard(params) {
    return request({
        url: `/merchant/card/v1/stop`,
        method: 'put',
        params
    })
}

//编辑卡信息
export function editCard(data) {
    return request({
        url: `/merchant/card/v1/card`,
        method: 'put',
        data
    })
}

//新增发行量/售卡数
export function addIssueTotal(params) {
    return request({
        url: `/merchant/card/v1/addIssueTotal`,
        method: 'put',
        params
    })
}

//中台福利卡获取商家
export function wealList(params) {
    return request({
        url: `/asset/card/weal/list`,
        method: 'get',
        params
    })
}



//新增卡商家
export function addCardShop(data) {
    return request({
      url: '/asset/card/weal',
      method: 'post',
      data
    })
}
//编辑卡商家
export function editCardShop(data) {
    return request({
      url: '/asset/card/weal',
      method: 'put',
      data
    })
}

//卡商家详情
export function cardShopdetail(params) {
    return request({
        url: `/asset/card/weal/detail`,
        method: 'get',
        params
    })
}

//删除卡商家
export function deleteCardShop(id) {
    return request({
        url: `/asset/card/weal/${id}`,
        method: 'DELETE',
    })
}

//中台福利卡会员列表
export function userList(params) {
    return request({
        url: `/asset/card/weal/user/list`,
        method: 'get',
        params
    })
}

//批量新增会员
export function addUserLists(data) {
    return request({
      url: '/asset/card/weal/user/addList',
      method: 'post',
      data
    })
}

//新增会员
export function addUserList(data) {
    return request({
      url: '/asset/card/weal/user',
      method: 'post',
      data
    })
}

// 会员概览
export function getMenderDetail(params) {
    return request({
        url: `/asset/card/weal/user/getInfo`,
        method: 'get',
        params
    })
}

//中台获取消费记录列表
export function consumeList(params) {
    return request({
        url: `/merchant/card/v1/consumeList`,
        method: 'get',
        params
    })
}